
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
    <title>API DOC</title>
    <link rel="stylesheet" href="css/weui.min.css"/> 
    <link rel="stylesheet" href="css/index.css"/>
	<style type="text/css">

	</style>
</head>
<body ontouchstart>
    <div class="weui-toptips weui-toptips_warn js_tooltips">错误提示</div>

    <div class="container" id="container"></div>

    <script type="text/html" id="tpl_home">
<div class="page">
  
	<div class="weui-tab">
	    <div class="weui-tab__panel">
	
		<div class="header">
			<div class="weui-flex" style="padding: 0;">
				<div class="weui-flex__item"><div class="placeholder"><img id="logo" src="images/laxcen.png"/></div></div>
				<div class="weui-flex__item"><div class="placeholder">基础开发平台</div></div>
				<div class="weui-flex__item"><div class="placeholder"><div id="version">版本:<span id="versionName">1.0.0</span></div></div></div>
			</div>
		</div>
 	
		<div class="page__bd page__bd_spacing on_page on_page_show">
		    <ul>
				<li>
				    <div class="weui-flex js_category">
				        <p class="weui-flex__item">基础功能</p>
				        <img src="images/icon_kc.png" alt="">
				    </div>
				    <div class="page__category js_categoryInner">
				        <div class="weui-cells page__category-content">
				            <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="hqjcsj" href="javascript:">
				                <div class="weui-cell__bd">
				                    <p>获取基础数据</p>
				                </div>
				                <div class="weui-cell__ft"></div>
				            </a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="hqdwxx" href="javascript:">
								<div class="weui-cell__bd">
									<p>获取定位信息</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="bddh" href="javascript:">
								<div class="weui-cell__bd">
									<p>拨打电话</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="xsjdts" href="javascript:">
								<div class="weui-cell__bd">
									<p>显示简单提示</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="hqsbzw" href="javascript:">
								<div class="weui-cell__bd">
									<p>获取设备指纹</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
				        </div>
				    </div>
				</li>
				
		        <li>
		            <div class="weui-flex js_category">
		                <p class="weui-flex__item">窗口管理</p>
		                <img src="images/icon_ck.png" alt="">
		            </div>
		            <div class="page__category js_categoryInner">
		                <div class="weui-cells page__category-content">
		                    <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="dkck" href="javascript:">
		                        <div class="weui-cell__bd">
		                            <p>打开窗口</p>
		                        </div>
		                        <div class="weui-cell__ft"></div>
		                    </a>
		                </div>
		            </div>
		        </li>
	
				<li>
					<div class="weui-flex js_category">
						<p class="weui-flex__item">APP控制</p>
						<img src="images/icon_app.png" alt="">
					</div>
					<div class="page__category js_categoryInner">
						<div class="weui-cells page__category-content">
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="gbapp" href="javascript:">
								<div class="weui-cell__bd">
									<p>关闭APP</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="cqapp" href="javascript:">
								<div class="weui-cell__bd">
									<p>重启APP</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
						</div>
					</div>
				</li>


				<li>
					<div class="weui-flex js_category">
						<p class="weui-flex__item">网络请求</p>
						<img src="images/icon_wl.png" alt="">
					</div>
					<div class="page__category js_categoryInner">
						<div class="weui-cells page__category-content">
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="csqq" href="javascript:">
								<div class="weui-cell__bd">
									<p>测试请求</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a> 
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="wjsc" href="javascript:">
								<div class="weui-cell__bd">
									<p>文件上传</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a> 
						</div>
					</div>
				</li>

				<li>
					<div class="weui-flex js_category">
						<p class="weui-flex__item">下载管理器</p>
						<img src="images/icon_xz.png" alt="">
					</div>
					<div class="page__category js_categoryInner">
						<div class="weui-cells page__category-content">
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="tjxzrw" href="javascript:">
								<div class="weui-cell__bd">
									<p>添加下载任务</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="ztxz" href="javascript:">
								<div class="weui-cell__bd">
									<p>暂停下载</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="qxxz" href="javascript:">
								<div class="weui-cell__bd">
									<p>取消下载</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
						</div>
					</div>
				</li>

				<li>
					<div class="weui-flex js_category">
						<p class="weui-flex__item">文件读写</p>
						<img src="images/icon_wj.png" alt="">
					</div>
					<div class="page__category js_categoryInner">
						<div class="weui-cells page__category-content">
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="dqwj" href="javascript:">
								<div class="weui-cell__bd">
									<p>读取文件</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="xrwj" href="javascript:">
								<div class="weui-cell__bd">
									<p>写入文件</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
						</div>
					</div>
				</li>

				<li>
					<div class="weui-flex js_category">
						<p class="weui-flex__item">键值读写</p>
						<img src="images/icon_jz.png" alt="">
					</div>
					<div class="page__category js_categoryInner">
						<div class="weui-cells page__category-content">
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="xrjzsj" href="javascript:">
								<div class="weui-cell__bd">
									<p>写入键值数据</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="dqjzsj" href="javascript:">
								<div class="weui-cell__bd">
									<p>读取键值数据</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
						</div>
					</div>
				</li>

			 
				
				<li>
					<div class="weui-flex js_category">
						<p class="weui-flex__item">媒体管理</p>
						<img src="images/icon_meiti.png" alt="">
					</div>
					<div class="page__category js_categoryInner">
						<div class="weui-cells page__category-content">
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="lykz" href="javascript:">
								<div class="weui-cell__bd">
									<p>录音</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="paizhao" href="javascript:">
								<div class="weui-cell__bd">
									<p>拍照</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="luxiang" href="javascript:">
								<div class="weui-cell__bd">
									<p>录像</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a> 
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="dkmtwj" href="javascript:">
								<div class="weui-cell__bd">
									<p>打开媒体文件</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a> 
						</div>
					</div>
				</li>
				
				<li>
					<div class="weui-flex js_category">
						<p class="weui-flex__item">数据库管理</p>
						<img src="images/icon_sjk.png" alt="">
					</div>
					<div class="page__category js_categoryInner">
						<div class="weui-cells page__category-content">
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="sjkjbcz" href="javascript:">
								<div class="weui-cell__bd">
									<p>数据库基本操作</p>
								</div>
								<div class="weui-cell__ft"></div>
							</a> 
						</div>
					</div>
				</li>
				
		    </ul>
		</div>
		
		<div class="page__bd page__bd_spacing on_page">
		    <ul>
		        <li>
		            <div class="weui-flex js_category">
		                <p class="weui-flex__item">订阅TOPIC</p>
		                <img src="images/icon_dy.png" alt="">
		            </div>
		            <div class="page__category js_categoryInner">
		                <div class="weui-cells page__category-content">
		                    <div class="weui-cells weui-cells_form">
		                      <div class="weui-cell" id="js_cell"> 
		                    	<div class="weui-cell__bd weui-flex">
		                    		<input id="dytopic" class="weui-input" type="text"  placeholder="请输入topic">
		                    	</div>
								<div class="weui-cell__ft">
									<a href="javascript:dingyue();" class="weui-btn weui-btn_mini weui-btn_primary">订阅</a>
								</div>
		                      </div> 
		                    </div>
		                </div>
		            </div>
		        </li>
				
				<li>
				    <div class="weui-flex js_category">
				        <p class="weui-flex__item">取消订阅TOPIC</p>
				        <img src="images/icon_undy.png" alt="">
				    </div>
				    <div class="page__category js_categoryInner">
				        <div class="weui-cells page__category-content">
				            <div class="weui-cells weui-cells_form">
				              <div class="weui-cell"> 
				            	<div class="weui-cell__bd weui-flex">
				            		<input id="undytopic" class="weui-input" type="text"  placeholder="请输入topic">
				            	</div>
								<div class="weui-cell__ft">
									<a href="javascript:undingyue();" class="weui-btn weui-btn_mini weui-btn_primary">取消订阅</a>
								</div>
				              </div> 
				            </div>
				        </div>
				    </div>
				</li>
		       
			   <li>
			       <div class="weui-flex js_category">
			           <p class="weui-flex__item">发送数据</p>
			           <img src="images/icon_fs.png" alt="">
			       </div>
			       <div class="page__category js_categoryInner">
			           <div class="weui-cells page__category-content">
			              <div class="weui-cells weui-cells_form">
							  <div class="weui-cell ">
							  	<div class="weui-cell__bd">
							  		<input class="weui-input" id="fssj-topic"  placeholder="请输入topic"/>
							  	</div>
							  </div>
			              	<div class="weui-cell ">
			              		<div class="weui-cell__bd" style="overflow: auto;height: 120px;">
			              			<textarea class="weui-textarea" id="fssj-data"  placeholder="请输入json数据" style="height: 100%;"></textarea>
			              		</div>
			              	</div>
							<div class="weui-cell">
								<div class="weui-cell__bd weui-flex"> 
								</div>
								<div class="weui-cell__ft">
									<a href="javascript:sendData();" class="weui-btn weui-btn_mini weui-btn_primary">发送数据</a>
								</div>
							</div> 
			              </div>
			           </div>
			       </div>
			   </li>
		     
			  <li>
			      <div class="weui-flex js_category">
			          <p class="weui-flex__item">数据监听</p>
			          <img src="images/icon_jt.png" alt="">
			      </div>
			      <div class="page__category js_categoryInner">
			          <div class="weui-cells page__category-content">
			             <div class="weui-cells weui-cells_form">
			             	<div class="weui-cell ">
			             		<div class="weui-cell__bd" id="listenbox" style="overflow: auto;height: 200px;">
			             			<div class="weui-textarea" id="listentxt" style="height: 100%;"></div>
			             		</div>
			             	</div>
			             </div>
			          </div>
			      </div>
			  </li>
			  
			  <li>
			      <div class="weui-flex js_category">
			          <p class="weui-flex__item">推送日志</p>
			          <img src="images/icon_tsrz.png" alt="">
			      </div>
			      <div class="page__category js_categoryInner">
			          <div class="weui-cells page__category-content">
			              <div class="weui-cells weui-cells_form">
			              	<div class="weui-cell ">
			              		<div class="weui-cell__bd" style="overflow: auto;height: 120px;">
			              			<textarea class="weui-textarea" id="tsrz"  placeholder="请输入json数据" style="height: 100%;"></textarea>
			              		</div>
			              	</div>
							<div class="weui-cell">
								<div class="weui-cell__bd weui-flex weui-cell_select weui-cell_select-before" id="showDengji">  
									 等级:<label class="weui-label" id="dengji">info</label> 
								</div>
								<div class="weui-cell__ft">
									<a href="javascript:tuisonrizhi();" class="weui-btn weui-btn_mini weui-btn_primary">推送日志</a>
								</div>
							</div> 
			              </div>
			          </div>
			      </div>
			  </li>
		      
		    </ul> 
			
		</div>
		
		<div class="page__bd page__bd_spacing on_page">
		    <ul>
		        <li>
		            <div class="weui-flex js_category">
		                <p class="weui-flex__item">基本组件</p>
		                <img src="images/icon_nav_form.png" alt="">
		            </div>
		            <div class="page__category js_categoryInner">
		                <div class="weui-cells page__category-content">
		                    <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="viewzj" href="javascript:">
		                        <div class="weui-cell__bd">
		                            <p>View组件</p>
		                        </div>
		                        <div class="weui-cell__ft"></div>
		                    </a>
		         
		                    <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="yyzj" href="javascript:">
		                        <div class="weui-cell__bd">
		                            <p>阴影组件</p>
		                        </div>
		                        <div class="weui-cell__ft"></div>
		                    </a> 
		                    <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="textzj" href="javascript:">
		                        <div class="weui-cell__bd">
		                            <p>Text组件</p>
		                        </div>
		                        <div class="weui-cell__ft"></div>
		                    </a>
		                    <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="imagezj" href="javascript:">
		                        <div class="weui-cell__bd">
		                            <p>Image组件</p>
		                        </div>
		                        <div class="weui-cell__ft"></div>
		                    </a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="listviewzj" href="javascript:">
							    <div class="weui-cell__bd">
							        <p>ListView组件</p>
							    </div>
							    <div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="textinputzj" href="javascript:">
							    <div class="weui-cell__bd">
							        <p>TextInput组件</p>
							    </div>
							    <div class="weui-cell__ft"></div>
							</a> 
		                </div>
		            </div>
		        </li>
		        <li>
		            <div class="weui-flex js_category">
		                <p class="weui-flex__item">复杂组件</p>
		                <img src="images/icon_nav_layout.png" alt="">
		            </div>
		            <div class="page__category js_categoryInner">
		                <div class="weui-cells page__category-content">
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="pullheaderzj" href="javascript:">
							    <div class="weui-cell__bd">
							        <p>PullHeader组件</p>
							    </div>
							    <div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="refreshwarpperzj" href="javascript:">
							    <div class="weui-cell__bd">
							        <p>RefreshWrapper组件</p>
							    </div>
							    <div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="scrollviewzj" href="javascript:">
							    <div class="weui-cell__bd">
							        <p>ScrollView组件</p>
							    </div>
							    <div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="viewpagerzj" href="javascript:">
							    <div class="weui-cell__bd">
							        <p>ViewPager组件</p>
							    </div>
							    <div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="jqbzj" href="javascript:">
							    <div class="weui-cell__bd">
							        <p>剪切板组件</p>
							    </div>
							    <div class="weui-cell__ft"></div>
							</a>
		                     <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="modalzj" href="javascript:">
		                         <div class="weui-cell__bd">
		                             <p>Modal组件</p>
		                         </div>
		                         <div class="weui-cell__ft"></div>
		                     </a>
		                     <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="sliderzj" href="javascript:">
		                         <div class="weui-cell__bd">
		                             <p>Slider组件</p>
		                         </div>
		                         <div class="weui-cell__ft"></div>
		                     </a>
		                     <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="tabhostzj" href="javascript:">
		                         <div class="weui-cell__bd">
		                             <p>TabHost组件</p>
		                         </div>
		                         <div class="weui-cell__ft"></div>
		                     </a>
		                     <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="zwebviewzj" href="javascript:">
		                         <div class="weui-cell__bd">
		                             <p>子WebView组件</p>
		                         </div>
		                         <div class="weui-cell__ft"></div>
		                     </a>
		                     <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="ysdhzj" href="javascript:">
		                         <div class="weui-cell__bd">
		                             <p>原生动画组件</p>
		                         </div>
		                         <div class="weui-cell__ft"></div>
		                     </a>
		                </div>
		            </div>
		        </li>
		     
		      
				<li>
				    <div class="weui-flex js_category">
				        <p class="weui-flex__item">插件</p>
				        <img src="images/icon_cj.png" alt="">
				    </div>
				    <div class="page__category js_categoryInner">
				        <div class="weui-cells page__category-content">
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="rlsb" href="javascript:">
							    <div class="weui-cell__bd">
							        <p>人脸识别</p>
							    </div>
							    <div class="weui-cell__ft"></div>
							</a>
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="jmg" href="javascript:">
							    <div class="weui-cell__bd">
							        <p>加密狗</p>
							    </div>
							    <div class="weui-cell__ft"></div>
							</a> 
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="rfid" href="javascript:">
							    <div class="weui-cell__bd">
							        <p>RFID</p>
							    </div>
							    <div class="weui-cell__ft"></div>
							</a> 
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="ewmsmq" href="javascript:">
							    <div class="weui-cell__bd">
							        <p>二维码扫描器</p>
							    </div>
							    <div class="weui-cell__ft"></div>
							</a> 
				        </div>
				    </div>
				</li>
						     
		    </ul>
		</div>
		
		<div class="page__bd page__bd_spacing on_page">
		    <ul>
		        <li>
		            <div class="weui-flex js_category">
		                <p class="weui-flex__item">版本更新</p>
		                <img src="images/icon_bb.png" alt="">
		            </div>
		            <div class="page__category js_categoryInner">
		                <div class="weui-cells page__category-content">
							<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="jcxbb" href="javascript:">
							    <div class="weui-cell__bd">
							        <p>检查新版本</p>
							    </div>
							    <div class="weui-cell__ft"></div>
							</a> 
		                </div>
		            </div>
		        </li>
		        <li>
		            <div class="weui-flex js_category">
		                <p class="weui-flex__item">应用管理</p>
		                <img src="images/icon_yy.png" alt="">
		            </div>
		            <div class="page__category js_categoryInner">
		                <div class="weui-cells page__category-content">
		                    <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="zxazxyy" href="javascript:">
		                        <div class="weui-cell__bd">
		                            <p>在线安装新应用</p>
		                        </div>
		                        <div class="weui-cell__ft"></div>
		                    </a>
		                    <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="ckyylb" href="javascript:">
		                        <div class="weui-cell__bd">
		                            <p>查看应用列表</p>
		                        </div>
		                        <div class="weui-cell__ft"></div>
		                    </a> 
		                </div>
		            </div>
		        </li>
		     
		      
		    </ul>
		</div>
		
		
		
		
	    </div>
	    <div class="weui-tabbar">
	        <div class="weui-tabbar__item weui-bar__item_on" index="1">
	            <div style="display: inline-block; position: relative;">
	                <img src="images/icon_api_b.png" alt="" class="weui-tabbar__icon">  
	                <span class="weui-badge" style="position: absolute; top: -2px; right: -13px;">9</span>
	            </div>
	            <p class="weui-tabbar__label">基础API</p>
	        </div>
	        <div class="weui-tabbar__item" index="2"> 
				<div style="display: inline-block; position: relative;">
				    <img src="images/icon_iot.png" alt="" class="weui-tabbar__icon">
				    <span class="weui-badge" style="position: absolute; top: -2px; right: -13px;">5</span>
				</div>
	            <p class="weui-tabbar__label">IoT平台</p>
	        </div>
	        <div class="weui-tabbar__item" index="3">
	            <div style="display: inline-block; position: relative;">
	                <img src="images/icon_zj.png" alt="" class="weui-tabbar__icon">
					<span class="weui-badge" style="position: absolute; top: -2px; right: -13px;">3</span> 
	            </div>
	            <p class="weui-tabbar__label">原生组件</p>
	        </div>
	        <div class="weui-tabbar__item" index="4">
	            <img src="images/icon_setting.png" alt="" class="weui-tabbar__icon">
	            <p class="weui-tabbar__label">设置</p>
	        </div>
	    </div>
	</div>
	
</div>
<script type="text/javascript">
    $(function(){ 
        var winH = $(window).height();
        var categorySpace = 10;

        $('.js_item').on('click', function(){
            var id = $(this).data('id');
            window.pageManager.go(id);
        });
        $('.js_category').on('click', function(){
            var $this = $(this),
                $inner = $this.next('.js_categoryInner'),
                $page = $this.parents('.page'),
                $parent = $(this).parent('li');
            var innerH = $inner.data('height');

            if(!innerH){
                $inner.css('height', 'auto');
                innerH = $inner.height();
                $inner.removeAttr('style');
                $inner.data('height', innerH);
            }

            if($parent.hasClass('js_show')){
                $parent.removeClass('js_show');
            }else{
                $parent.siblings().removeClass('js_show');

                $parent.addClass('js_show');
                if(this.offsetTop + this.offsetHeight + innerH > $page.scrollTop() + winH){
                    var scrollTop = this.offsetTop + this.offsetHeight + innerH - winH + categorySpace;

                    if(scrollTop > this.offsetTop){
                        scrollTop = this.offsetTop - categorySpace;
                    }

                    $page.scrollTop(scrollTop);
                }
            } 
        });
    });
	
	$(function(){
			$('#showDengji').on('click', function () {
					   weui.picker([{
						   label: 'FATAL',
						   value: 'fatal'
					   }, {
						   label: 'ERROR',
						   value: 'error'
					   }, {
						   label: 'WARNING',
						   value: 'warning'
					   },{
						   label: 'INFO',
						   value: 'info'
					   }, {
						   label: 'DEBUG',
						   value: 'debug'
					   }], {
						   onConfirm: function (result) { 
							   $("#dengji").html(result);
						   },
						   title: '请选择错误等级'
					   });
			});
			
				
	    $('.weui-tabbar__item').on('click', function () {
	        $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');
			var index = $(this).attr("index");
			 $($(".on_page")[index-1]).addClass('on_page_show').siblings('.on_page_show').removeClass('on_page_show');
			
			var doms = $(".weui-tabbar__icon");
			var icon = ["images/icon_api.png","images/icon_iot.png","images/icon_zj.png","images/icon_setting.png"];
			var icon_b = ["images/icon_api_b.png","images/icon_iot_b.png","images/icon_zj_b.png","images/icon_setting_b.png"];
			for(var i = 0 ; i < doms.length;i++){ 
				if(i+1==index){
					$(doms[i]).attr("src",icon_b[i]);
				}else{
					$(doms[i]).attr("src",icon[i]);
				}
			}
	    });
		try{
			var consts = JSON.parse(api.getConst());
			$("#versionName").html(consts.appVersion);
		}catch(e){
			
		} 
	});
	
	//订阅
	function dingyue(){
		var dytopic = $("#dytopic").val();
		if(!dytopic){
			api.showToast("请输入topic!");
			return;
		 }
		 api.subscribeTopic(dytopic);
		 api.showToast("已订阅");
	}
	//取消订阅
	function undingyue(){
		var undytopic = $("#undytopic").val();
		if(!undytopic){
			api.showToast("请输入topic!");
			return;
		 }
		 api.unsubscribeTopic(undytopic);
		  api.showToast("已取消订阅");
	}
	//发送数据
	function sendData() {
		 var topic = $api.val($api.byId('fssj-topic'));
		 if(!topic){
			api.showToast("请输入topic!");
			return;
		 }
		 var message = $api.val($api.byId('fssj-data'));
		 if(!message){
			api.showToast("请输入json数据!");
			return;
		 }
		 api.sendData(topic,message);
		  api.showToast("已发送");
	}
	//数据监听
	function dataListener() {
		 api.dataListener(function(ret){
			 var box = $api.byId('listentxt');
			 var date = new Date();
			 var fdate = date.format("yyyy-MM-dd hh:mm:ss");
			 $api.append(box,fdate+' '+ret+"<br/>");
			 $api.byId('listenbox').scrollTop = box.scrollHeight; 
		 });
	}
	dataListener();
	
	//推送日志
	function tuisonrizhi(){
		var dengji = $api.html($api.byId('dengji'));
		if(!dengji){
			api.showToast("请选择推送等级!");
			return;
		}
		var tsrz = $api.val($api.byId('tsrz'));
		if(!tsrz){
			api.showToast("请输入日志json数据!");
			return;
		}
		api.pushLog(dengji,tsrz);
		api.showToast("已发送");
	}  
</script>

</script>
    <script type="text/html" id="tpl_hqjcsj">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	获取基础数据
	</div>
    <div class="page__hd">
        <div class="j_info page__info" data-for="normal">
            <h2 class="page__title">获取的数据</h2>
           <div class="weui-cells weui-cells_form">
           	<div class="weui-cell ">
           		<div class="weui-cell__bd" id="methodResultBox" style="overflow: auto;height: 200px;">
           			<textarea class="weui-textarea" id="methodResult" placeholder="这里显示结果" style="height: 100%;"></textarea>
           		</div>
           	</div>
           </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function(){ 
         var sysconst = api.getConst();
		 $("#methodResult").val(sysconst);
    });
</script>
</script>


    <script type="text/html" id="tpl_hqdwxx">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	获取定位信息
	</div>
    <div class="page__hd">
        <div class="j_info page__info" data-for="normal">
            <div class="button-sp-area">
                  <a href="javascript:getDinwei();" class="weui-btn weui-btn_primary">点击获取定位信息</a>
			</div> 
			<div class="weui-cells weui-cells_form">
				<div class="weui-cell ">
					<div class="weui-cell__bd" id="methodResultBox" style="overflow: auto;height: 200px;">
						<textarea class="weui-textarea" id="methodResult" placeholder="这里显示结果" style="height: 100%;"></textarea>
					</div>
				</div>
			</div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function getDinwei(){
		$("#methodResult").val("获取中...");
		api.getLocation(function(ret){
			$("#methodResult").val(ret);
		});
	}
</script>
</script>


<script type="text/html" id="tpl_bddh">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	拨打电话
	</div>
    <div class="page__bd">
        <div class="j_info page__info" data-for="normal">
            <div class="weui-form__control-area">
			  <div class="weui-cells__group weui-cells__group_form"> 
				<div class="weui-cells weui-cells_form">
				  <div class="weui-cell weui-cell_active">
					<div class="weui-cell__hd"><label class="weui-label">手机号</label></div>
					<div class="weui-cell__bd">
						<input id="yourphone" type="number" class="weui-input" placeholder="请输入手机号">
					</div>
				  </div> 
				</div>
			  </div>
			</div>
           <div class="weui-form__opr-area">
                 <a class="weui-btn weui-btn_primary" href="javascript:call();">拨打电话</a>
           </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function call(){
		var tel = $("#yourphone").val();
		if(tel==''||tel.length!=11){
			api.showToast("请输入正确的手机号!");
			return;
		} 
		api.callTel(tel);
	}
</script>
</script>


<script type="text/html" id="tpl_xsjdts">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	显示简单提示
	</div>
    <div class="page__bd">
        <div class="j_info page__info" data-for="normal">
            <div class="weui-form__control-area">
			  <div class="weui-cells__group weui-cells__group_form"> 
				<div class="weui-cells weui-cells_form">
				  <div class="weui-cell weui-cell_active">
					<div class="weui-cell__hd"><label class="weui-label">提示内容</label></div>
					<div class="weui-cell__bd">
						<input id="inputtips" class="weui-input" placeholder="请输入提示内容">
					</div>
				  </div> 
				</div>
			  </div>
			</div>
           <div class="weui-form__opr-area">
                 <a class="weui-btn weui-btn_primary" href="javascript:tips();">提示</a>
           </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function tips(){
		var tel = $("#inputtips").val();
		if(tel==''){
			api.showToast("请输入提示内容!");
			return;
		} 
		api.showToast(tel);
	}
</script>
</script>


 <script type="text/html" id="tpl_hqsbzw">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	获取设备指纹
	</div>
    <div class="page__hd">
        <div class="j_info page__info" data-for="normal">
            <div class="button-sp-area">
                  <a href="javascript:getzhiwen();" class="weui-btn weui-btn_primary">点击获取</a>
			</div>
			<p class="page__desc">设备指纹是设备的唯一标识，即使卸载APP在这个设备上重装指纹码依然不会改变，第一次获取约耗时30ms，之后的获取速度会很快。</p>
			<div class="weui-cells weui-cells_form">
				<div class="weui-cell ">
					<div class="weui-cell__bd" id="methodResultBox" style="overflow: auto;height: 200px;">
						<textarea class="weui-textarea" id="methodResult" placeholder="这里显示结果" style="height: 100%;"></textarea>
					</div>
				</div>
			</div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function getzhiwen(){
		$("#methodResult").val("获取中...");
		api.getFingerprint(function(ret){
			$("#methodResult").val("此设备永久唯一的指纹码:"+ret);
		});
	}
</script>
</script>

 <script type="text/html" id="tpl_dkck">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	打开窗口
	</div>
    <div class="page__bd">
        <div class="j_info page__info" data-for="normal">
			<div class="weui-form__control-area">
			  <div class="weui-cells__group weui-cells__group_form"> 
				<div class="weui-cells weui-cells_form">
				  <div class="weui-cell weui-cell_active">
					<div class="weui-cell__hd"><label class="weui-label">名称</label></div>
					<div class="weui-cell__bd">
						<input id="winName" class="weui-input" placeholder="请输入窗口">
					</div>
				  </div> 
				  <div class="weui-cell weui-cell_active">
					<div class="weui-cell__hd"><label class="weui-label">参数</label></div>
					<div class="weui-cell__bd">
						<input id="winData" class="weui-input" placeholder="请输入参数">
					</div>
				  </div> 
				</div>
			  </div>
			</div>
            <div class="button-sp-area">
                  <a href="javascript:openWin();" class="weui-btn weui-btn_primary">点击打开新窗口</a>
			</div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function openWin(){ 
		var winName = $api.val($api.byId('winName'));
		var winData = $api.val($api.byId('winData'));
		var url = 'page.html';
		api.openWin(url,winName,winData);
	}
</script>
</script>



<script type="text/html" id="tpl_gbapp">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	关闭APP
	</div>
    <div class="page__bd">
        <div class="j_info page__info" data-for="normal">
           <div class="weui-form__opr-area">
                 <a class="weui-btn weui-btn_primary" href="javascript:cloasApp();">点击关闭APP</a>
           </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function cloasApp(){ 
		 api.finishApp();
	}
</script>
</script>


<script type="text/html" id="tpl_cqapp">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	重启APP
	</div>
    <div class="page__bd">
        <div class="j_info page__info" data-for="normal">
           <div class="weui-form__opr-area">
                 <a class="weui-btn weui-btn_primary" href="javascript:rebootApp();">点击重启APP</a>
           </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function rebootApp(){ 
		 api.rebootApp();
	}
</script>
</script>



<script type="text/html" id="tpl_csqq">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	网络请求
	</div>
     
        <div class="j_info page__info" data-for="normal">
           <div class="weui-form">
               <div class="weui-form__control-area">
                 <div class="weui-cells__group weui-cells__group_form">
                   <div class="weui-cells">
                     <div class="weui-cell weui-cell_active weui-cell_access" onclick="qingqiufangshi()">
                       <div class="weui-cell__bd">请求方式</div>
					   <div class="weui-cell__bd">
					     <input class="weui-input" id="qqfs" value="GET"  disabled="disabled">
					   </div>
                       <div class="weui-cell__ft"></div>
                     </div>
                     <div class="weui-cell weui-cell_active weui-cell_access">
                       <div class="weui-cell__hd"><label class="weui-label">URL</label></div>
                       <div class="weui-cell__bd">
                         <textarea class="weui-textarea" id="url"  rows="3" placeholder="请输入URL">
							 https://www.baidu.com/sugrec?prod=pc_his&from=pc_web&json=1&sid=33802_33970_31253_33848_33675_33607_34134_34094_26350_22158&hisdata=%5B%7B%22time%22%3A1624183635%2C%22kw%22%3A%22%E5%A6%82%E4%BD%95%E9%87%8D%E5%A4%8D%E6%89%93%E5%BC%80%E8%87%AA%E8%BA%ABactivity%22%7D%2C%7B%22time%22%3A1624183668%2C%22kw%22%3A%22%E5%A6%82%E4%BD%95%E9%87%8D%E5%A4%8D%E6%89%93%E5%BC%80%E5%B7%B2%E5%AD%98%E5%9C%A8activity%22%7D%2C%7B%22time%22%3A1624183743%2C%22kw%22%3A%22activity%20%E5%90%AF%E5%8A%A8%E6%A8%A1%E5%BC%8F%22%7D%2C%7B%22time%22%3A1624183909%2C%22kw%22%3A%22activitya%20%E6%89%93%E5%BC%80%20a%22%7D%2C%7B%22time%22%3A1624183952%2C%22kw%22%3A%22activity%20a%20%E6%89%93%E5%BC%80%20a%22%2C%22fq%22%3A2%7D%2C%7B%22time%22%3A1624193816%2C%22kw%22%3A%22%E7%BF%BB%E8%AF%91%20syn%22%7D%2C%7B%22time%22%3A1624193821%2C%22kw%22%3A%22%E7%BF%BB%E8%AF%91%20sync%22%7D%2C%7B%22time%22%3A1624197125%2C%22kw%22%3A%22js%20date%20%E6%A0%BC%E5%BC%8F%E5%8C%96%22%7D%2C%7B%22time%22%3A1624197843%2C%22kw%22%3A%22preview%22%7D%2C%7B%22time%22%3A1624199115%2C%22kw%22%3A%22js%20%E6%97%A5%E6%9C%9F%E6%A0%BC%E5%BC%8F%E5%8C%96%22%7D%5D&_t=1624199664965&req=2&sc=eb&csor=0
						 </textarea>
                       </div>
                     </div>
                      <div class="weui-cell weui-cell_active weui-cell_access">
                        <div class="weui-cell__hd"><label class="weui-label">Header参数</label></div>
                        <div class="weui-cell__bd">
                          <textarea class="weui-textarea" id="headercs"  rows="3" placeholder="请输入Header里的数据">
							  {"token":"123456","Content-Type": "application/json;charset=utf-8"}
						  </textarea>
                        </div>
                      </div>
					  <div class="weui-cell weui-cell_active weui-cell_access">
					    <div class="weui-cell__hd"><label class="weui-label">提交参数</label></div>
					    <div class="weui-cell__bd">
					      <textarea class="weui-textarea" id="tjcs"  rows="3" placeholder="请输入提交参数">
							{"name":"你好"}
						  </textarea>
					    </div>
					  </div> 
                   </div>
                 </div>
               </div>
				
				<div class="weui-form__opr-area">
				      <a class="weui-btn weui-btn_primary" href="javascript:submitMethod();">发送请求</a>
				</div>
				<div class="weui-cell weui-cell_active weui-cell_access">
				  <div class="weui-cell__hd"><label class="weui-label">当前请求标识</label></div>
				  <div class="weui-cell__bd">
				    <div id="dqqqbs"></div>
				  </div>
				</div> 
				
				<div class="weui-cell weui-cell_active weui-cell_access">
				  <div class="weui-cell__hd"><label class="weui-label">请求状态</label></div>
				  <div class="weui-cell__bd">
				    <div id="qqzt"></div>
				  </div>
				</div> 
				
				<div class="weui-form__opr-area">
				      <a class="weui-btn weui-btn_warn" href="javascript:cancelMethod();">取消当前请求</a>
				</div>
				
				
				<div class="weui-cells__group weui-cells__group_form">
					<div class="weui-cells__title">请求结果</div>
					<div class="weui-cells weui-cells_form">
						<div class="weui-cell ">
							<div class="weui-cell__bd" id="methodResultBox" style="overflow: auto;height: 200px;">
								<div class="weui-textarea" id="methodResult" placeholder="这里显示结果" style="height: 100%;"></div>
							</div>
						</div>
					</div>
				  </div>
			 </div>
			 
			 
     
    </div>
</div>
<script type="text/javascript">
   function qingqiufangshi(){
	   weui.picker([{
	               label: 'GET',
	               value: 'GET'
	           }, {
	               label: 'POST',
	               value: 'POST'
	           }, {
	               label: 'HEAD',
	               value: 'HEAD'
	           }, {
	               label: 'DELETE',
	               value: 'DELETE'
	           }, {
	               label: 'PUT',
	               value: 'PUT'
	           }, {
	               label: 'PATCH',
	               value: 'PATCH'
	           }, {
	               label: 'OPTION',
	               value: 'OPTION'
	           }, {
	               label: 'TRACE',
	               value: 'TRACE'
	           }], {
	               onChange: function (result) { 
					  
	               },
	               onConfirm: function (result) {
	                    $("#qqfs").val(result);
	               },
	               title: '请选择请求方式'
	           });
   }
   var requestId;
   function submitMethod(){
	   var url = $.trim($api.val($api.byId("url")));
	   var qqfs = $.trim($api.val($api.byId("qqfs")));
	   var headercs = $.trim($api.val($api.byId("headercs")));
	   var tjcs = $.trim($api.val($api.byId("tjcs")));
	   if(url==''){
		   api.showToast("请输入URL!");
		   return;
	   }
	   if(headercs==''){
		   headercs='{}';
	   } 
	   try{
		    headercs = JSON.parse(headercs);
	   }catch(e){
		   pushAjaxLog(6,"header参数转json出错:"+e);
	   }
	  
	   if(tjcs==''){
		   tjcs='{}';
	   }
	   try{ 
			tjcs= JSON.parse(tjcs);
	   }catch(e){
	   		 pushAjaxLog(6,"提交参数转json出错:"+e);   
	   }
	  
	  console.log(headercs);
	   var data = {
		   url: url,
		   method:qqfs,
		   header:headercs,
		   data:tjcs
		};
		console.log(data);
		requestId = api.ajax(data,function(ret){
			ret = JSON.parse(ret);
			/**
			 * -1 用户取消
			 * 0 请求失败
			 * 1 开始请求/上传
			 * 2 请求中/上传中
			 * 3 请求/上传完成
			 * 4 全部请求/上传完成
			 * 5 请求超时
			 */
			 switch(ret.status){
				case -1:
					pushAjaxLog(ret.status,ret.msg+' requestId->'+requestId);
					break;
				 case 0:
					pushAjaxLog(ret.status,ret.msg+' requestId->'+requestId);
					break;
				  case 1:
					pushAjaxLog(ret.status,JSON.stringify(ret)+' requestId->'+requestId);
					break;
				  case 2:
					pushAjaxLog(ret.status,JSON.stringify(ret)+' requestId->'+requestId);
					break;
				  case 3:
					pushAjaxLog(ret.status,JSON.stringify(ret)+' requestId->'+requestId);
					break;
				  case 4:
					pushAjaxLog(ret.status,JSON.stringify(ret)+' requestId->'+requestId);
					break;
				  case 5:
					pushAjaxLog(ret.status,ret.msg+' requestId->'+requestId);
					break;

			 }
	 });
		
	  //显示当前请求标识
	  if(requestId){
		   $api.html($api.byId("dqqqbs"),requestId);
	  }
   }
   var statusData = ['用户取消','请求失败','开始请求/上传','请求中/上传中','请求/上传完成','全部请求/上传完成','请求超时','请求前出错'];
   function pushAjaxLog(status,log){   
		  $api.html($api.byId("qqzt"),statusData[status+1]);
		  var box = $api.byId('methodResult');
		  var date = new Date();
		  var fdate = date.format("yyyy-MM-dd hh:mm:ss");
		  $api.append(box,fdate+' '+log+"<br/>");
		  $api.byId('methodResultBox').scrollTop = box.scrollHeight;
   }
   function cancelMethod(){
	    api.cancelAjax(requestId);
   }
</script>
</script>


<script type="text/html" id="tpl_wjsc">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	文件上传管理
	</div>
     
        <div class="j_info page__info" data-for="normal">
			
			<div class="weui-gallery" id="gallery" style="opacity: 0; display: none;">
				<span class="weui-gallery__img" id="galleryImg" style="background-image: url(./images/pic_160.png);"></span>
				<div class="weui-gallery__opr">
					<a href="javascript:" class="weui-gallery__del">
						<i class="weui-icon-delete weui-icon_gallery-delete"></i>
					</a>
				</div>
			</div>
			
           <div class="weui-form"> 
               <div class="weui-form__control-area">
                 <div class="weui-cells__group weui-cells__group_form">
                   <div class="weui-cells">
                     <div class="weui-cell weui-cell_active weui-cell_access" onclick="qingqiufangshi()">
                       <div class="weui-cell__bd">请求方式</div>
					   <div class="weui-cell__bd">
					     <input class="weui-input" id="qqfs" value="GET"  disabled="disabled">
					   </div>
                       <div class="weui-cell__ft"></div>
                     </div>
                     <div class="weui-cell weui-cell_active weui-cell_access">
                       <div class="weui-cell__hd"><label class="weui-label">URL</label></div>
                       <div class="weui-cell__bd">
                         <textarea class="weui-textarea" id="url"  rows="3" placeholder="请输入URL">
							 https://soucre.oss-cn-hangzhou.aliyuncs.com/appversion/update.json
						 </textarea>
                       </div>
                     </div>
                      <div class="weui-cell weui-cell_active weui-cell_access">
                        <div class="weui-cell__hd"><label class="weui-label">Header参数</label></div>
                        <div class="weui-cell__bd">
                          <textarea class="weui-textarea" id="headercs"  rows="3" placeholder="请输入Header里的数据">
							  {"token":"123456","Content-Type": "application/json;charset=utf-8"}
						  </textarea>
                        </div>
                      </div>
					  <div class="weui-cell weui-cell_active weui-cell_access">
					    <div class="weui-cell__hd"><label class="weui-label">提交参数</label></div>
					    <div class="weui-cell__bd">
					      <textarea class="weui-textarea" id="tjcs"  rows="3" placeholder="请输入提交参数">
							{"name":"你好"}
						  </textarea>
					    </div>
					  </div> 
					  
					  
					  <div class="weui-cell  weui-cell_uploader">
						  <div class="weui-cell__bd">
							  <div class="weui-uploader">
								  <div class="weui-uploader__hd">
									  <p class="weui-uploader__title">请选择要上传的文件</p>
									  <div class="weui-uploader__info">1/9</div>
								  </div>
								  <div class="weui-uploader__bd">
									  <ul class="weui-uploader__files" id="uploaderFiles"></ul>
									  <div class="weui-uploader__input-box">
										  <input id="uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple="">
									  </div>
								  </div>
							  </div>
						  </div>
					  </div>
					  
                   </div>
                 </div>
               </div>
				
				<div class="weui-form__opr-area">
				      <a class="weui-btn weui-btn_primary" href="javascript:submitMethod();">发送请求</a>
				</div>
				
				<div class="weui-cells__title">请求队列</div>
				<div class="weui-cells">
					<a class="weui-cell  weui-cell_access" href="javascript:">
						<div class="weui-cell__bd">
							<p>3jsdfsndnijgnsd</p>
							<p>进度:</p>
						</div>
						<div class="weui-cell__ft">
							<a href="javascript:" class="weui-btn weui-btn_mini weui-btn_default">暂停</a>
							<a href="javascript:" class="weui-btn weui-btn_mini weui-btn_warn">取消</a>
						</div>
					</a>
					<a class="weui-cell  weui-cell_access" href="javascript:">
						<div class="weui-cell__bd">
							<p>njisnjdnfjsdnif</p>
							<p>进度:</p>
						</div>
						<div class="weui-cell__ft">
							<a href="javascript:" class="weui-btn weui-btn_mini weui-btn_default">暂停</a>
							<a href="javascript:" class="weui-btn weui-btn_mini weui-btn_warn">取消</a>
						</div>
					</a>
				</div>
				
				<div class="weui-cell weui-cell_active weui-cell_access">
				  <div class="weui-cell__hd"><label class="weui-label">当前请求标识</label></div>
				  <div class="weui-cell__bd">
				    <div id="dqqqbs"></div>
				  </div>
				</div> 
				
				<div class="weui-cell weui-cell_active weui-cell_access">
				  <div class="weui-cell__hd"><label class="weui-label">请求状态</label></div>
				  <div class="weui-cell__bd">
				    <div id="qqzt"></div>
				  </div>
				</div> 
				
				<div class="weui-form__opr-area">
				      <a class="weui-btn weui-btn_warn" href="javascript:cancelMethod();">取消当前请求</a>
				</div>
				
				
				<div class="weui-cells__group weui-cells__group_form">
					<div class="weui-cells__title">请求结果</div>
					<div class="weui-cells weui-cells_form">
						<div class="weui-cell ">
							<div class="weui-cell__bd" id="methodResultBox" style="overflow: auto;height: 200px;">
								<div class="weui-textarea" id="methodResult" placeholder="这里显示结果" style="height: 100%;"></div>
							</div>
						</div>
					</div>
				  </div>
			 </div>
			 
			 
     
    </div>
</div>
<script type="text/javascript">
	  $(function(){
		var tmpl = '<li class="weui-uploader__file" style="background-image:url(#url#)"></li>',
			$gallery = $("#gallery"), $galleryImg = $("#galleryImg"),
			$uploaderInput = $("#uploaderInput"),
			$uploaderFiles = $("#uploaderFiles")
			;

		$uploaderInput.on("change", function(e){
			var src, url = window.URL || window.webkitURL || window.mozURL, files = e.target.files;
			for (var i = 0, len = files.length; i < len; ++i) {
				var file = files[i];

				if (url) {
					src = url.createObjectURL(file);
				} else {
					src = e.target.result;
				}

				$uploaderFiles.append($(tmpl.replace('#url#', src)));
			}
		});
		$uploaderFiles.on("click", "li", function(){
			$galleryImg.attr("style", this.getAttribute("style"));
			$gallery.fadeIn(100);
		});
		$gallery.on("click", function(){
			$gallery.fadeOut(100);
		});
	});
   function qingqiufangshi(){
	   weui.picker([{
	               label: 'GET',
	               value: 'GET'
	           }, {
	               label: 'POST',
	               value: 'POST'
	           }, {
	               label: 'HEAD',
	               value: 'HEAD'
	           }, {
	               label: 'DELETE',
	               value: 'DELETE'
	           }, {
	               label: 'PUT',
	               value: 'PUT'
	           }, {
	               label: 'PATCH',
	               value: 'PATCH'
	           }, {
	               label: 'OPTION',
	               value: 'OPTION'
	           }, {
	               label: 'TRACE',
	               value: 'TRACE'
	           }], {
	               onChange: function (result) { 
					  
	               },
	               onConfirm: function (result) {
	                    $("#qqfs").val(result);
	               },
	               title: '请选择请求方式'
	           });
   }
   var requestId;
   function submitMethod(){
	   var url = $.trim($api.val($api.byId("url")));
	   var qqfs = $.trim($api.val($api.byId("qqfs")));
	   var headercs = $.trim($api.val($api.byId("headercs")));
	   var tjcs = $.trim($api.val($api.byId("tjcs")));
	   if(url==''){
		   api.showToast("请输入URL!");
		   return;
	   }
	   if(headercs==''){
		   headercs='{}';
	   } 
	   try{
		    headercs = JSON.parse(headercs);
	   }catch(e){
		   pushAjaxLog(6,"header参数转json出错:"+e);
	   }
	  
	   if(tjcs==''){
		   tjcs='{}';
	   }
	   try{ 
			tjcs= JSON.parse(tjcs);
	   }catch(e){
	   		 pushAjaxLog(6,"提交参数转json出错:"+e);   
	   }
	  
	  console.log(headercs);
	   var data = {
		   url: url,
		   method:qqfs,
		   header:headercs,
		   data:tjcs
		};
		console.log(data);
		requestId = api.ajax(data,function(ret){
			ret = JSON.parse(ret);
			/**
			 * -1 用户取消
			 * 0 请求失败
			 * 1 开始请求/上传
			 * 2 请求中/上传中
			 * 3 请求/上传完成
			 * 4 全部请求/上传完成
			 * 5 请求超时
			 */
			 switch(ret.status){
				case -1:
					pushAjaxLog(ret.status,ret.msg+' requestId->'+requestId);
					break;
				 case 0:
					pushAjaxLog(ret.status,ret.msg+' requestId->'+requestId);
					break;
				  case 1:
					pushAjaxLog(ret.status,JSON.stringify(ret)+' requestId->'+requestId);
					break;
				  case 2:
					pushAjaxLog(ret.status,JSON.stringify(ret)+' requestId->'+requestId);
					break;
				  case 3:
					pushAjaxLog(ret.status,JSON.stringify(ret)+' requestId->'+requestId);
					break;
				  case 4:
					pushAjaxLog(ret.status,JSON.stringify(ret)+' requestId->'+requestId);
					break;
				  case 5:
					pushAjaxLog(ret.status,ret.msg+' requestId->'+requestId);
					break;

			 }
	 });
		
	  //显示当前请求标识
	  if(requestId){
		   $api.html($api.byId("dqqqbs"),requestId);
	  }
   }
   var statusData = ['用户取消','请求失败','开始请求/上传','请求中/上传中','请求/上传完成','全部请求/上传完成','请求超时','请求前出错'];
   function pushAjaxLog(status,log){   
		  $api.html($api.byId("qqzt"),statusData[status+1]);
		  var box = $api.byId('methodResult');
		  var date = new Date();
		  var fdate = date.format("yyyy-MM-dd hh:mm:ss");
		  $api.append(box,fdate+' '+log+"<br/>");
		  $api.byId('methodResultBox').scrollTop = box.scrollHeight;
   }
   function cancelMethod(){
	    api.cancelAjax(requestId);
   }
</script>
</script>


<script type="text/html" id="tpl_tjxzrw">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	添加下载任务
	</div>
    <div class="page__bd">
        <div class="j_info page__info" data-for="normal">
           <div class="weui-form__opr-area"> 
				<div class="weui-cells__group weui-cells__group_form">
						<a href="javascript:addTest();" class="weui-btn weui-btn_default">测试地址</a>
				        <div class="weui-cells__title">请添加下载地址</div>
				        <div class="weui-cells weui-cells_form">
				          <div class="weui-cell weui-cell_active" id="js_cell">
				            <div class="weui-cell__hd"><label class="weui-label">地址</label></div>
				            <div class="weui-cell__bd weui-flex">
				                <input id="js_input" class="weui-input" autofocus="" type="text"  placeholder="请填写下载地址">
				            </div>
				          </div> 
				        </div>
				      </div> 
           </div>
		   
		   <div class="weui-form__opr-area">
		         <a class="weui-btn weui-btn_primary" href="javascript:download();">下载</a>
		   </div>
		  
        </div>
		
		<div class="weui-cells__group weui-cells__group_form">
			<div class="weui-cells__title">下载日志</div>
			<div class="weui-cells weui-cells_form">
				<div class="weui-cell ">
					<div class="weui-cell__bd" id="methodResultBox" style="overflow: auto;height: 200px;">
						<div class="weui-textarea" id="methodResult"  style="height: 100%;"></div>
					</div>
				</div>
			</div>
		  </div>
		
		
		<div class="weui-cells__title">下载队列</div>
		<div class="weui-cells">
			<a class="weui-cell  weui-cell_access" href="javascript:">
				<div class="weui-cell__bd">
					<p>3jsdfsndnijgnsd</p>
					<p>进度:</p>
				</div>
				<div class="weui-cell__ft"  style="margin-right: 10px;">
							<a href="javascript:" class="weui-btn weui-btn_mini weui-btn_default">复制</a>
					<a href="javascript:" class="weui-btn weui-btn_mini weui-btn_default">暂停</a>
					<a href="javascript:" class="weui-btn weui-btn_mini weui-btn_warn">取消</a>
				</div>
			</a>
			<a class="weui-cell  weui-cell_access" href="javascript:">
				<div class="weui-cell__bd">
					<p>njisnjdnfjsdnif</p>
					<p>进度:</p>
				</div>
				<div class="weui-cell__ft" style="margin-right: 10px;">
							<a href="javascript:" class="weui-btn weui-btn_mini weui-btn_default">复制</a>
					<a href="javascript:" class="weui-btn weui-btn_mini weui-btn_default">暂停</a>
					<a href="javascript:" class="weui-btn weui-btn_mini weui-btn_warn">取消</a>
				</div>
			</a>
		</div>
		
		
    </div>
</div>
<script type="text/javascript">
	function addTest(){
		var path = "https://soucre.oss-cn-hangzhou.aliyuncs.com/appversion/test.zip";
		$("#js_input").val(path);
	}
	function download(){
		var path = $("#js_input").val();
		if(!path){
			api.showToast("请填写下载地址!");
			return;
		}
		api.download(path,function(ret){
			pushAjaxLog(ret);
		});
	}
   
   function pushAjaxLog(log){ 
   		  var box = $api.byId('methodResult');
   		  var date = new Date();
   		  var fdate = date.format("yyyy-MM-dd hh:mm:ss");
   		  $api.append(box,fdate+' '+log+"<br/>");
   		  $api.byId('methodResultBox').scrollTop = box.scrollHeight;
   }
</script>
</script>


<script type="text/html" id="tpl_ztxz">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	暂停下载
	</div>
    <div class="page__bd">
       <div class="j_info page__info" data-for="normal">
          <div class="weui-form__opr-area"> 
       		<div class="weui-cells__group weui-cells__group_form">
				<a href="javascript:addTest();" class="weui-btn weui-btn_default">测试地址</a>
       		        <div class="weui-cells__title">请输入暂停下载的地址</div>
       		        <div class="weui-cells weui-cells_form">
       		          <div class="weui-cell weui-cell_active" id="js_cell">
       		            <div class="weui-cell__hd"><label class="weui-label">地址</label></div>
       		            <div class="weui-cell__bd weui-flex">
       		                <input id="js_input" class="weui-input" autofocus="" type="text"  placeholder="请输入暂停下载的地址">
       		            </div>
       		          </div> 
       		        </div>
       		      </div> 
          </div>
          
          <div class="weui-form__opr-area">
                <a class="weui-btn weui-btn_primary" href="javascript:pauseDownload();">暂停下载</a>
          </div>
         
       </div>
    </div>
</div>
<script type="text/javascript">
	function addTest(){
		var path = "https://soucre.oss-cn-hangzhou.aliyuncs.com/appversion/test.zip";
		$("#js_input").val(path);
	}
	
   function pauseDownload() {
		var url = $("#js_input").val();
		 api.pauseDownload(url);
	}
   
</script>
</script>


<script type="text/html" id="tpl_qxxz">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	取消下载
	</div>
    <div class="page__bd">
        <div class="j_info page__info" data-for="normal">
           <div class="weui-form__opr-area"> 
        		<div class="weui-cells__group weui-cells__group_form">
					<a href="javascript:addTest();" class="weui-btn weui-btn_default">测试地址</a>
        		        <div class="weui-cells__title">请输入取消下载的地址</div>
        		        <div class="weui-cells weui-cells_form">
        		          <div class="weui-cell weui-cell_active" id="js_cell">
        		            <div class="weui-cell__hd"><label class="weui-label">地址</label></div>
        		            <div class="weui-cell__bd weui-flex">
        		                <input id="js_input" class="weui-input" autofocus="" type="text"  placeholder="请输入取消下载的地址">
        		            </div>
        		          </div> 
        		        </div>
        		      </div> 
           </div>
           
           <div class="weui-form__opr-area">
                 <a class="weui-btn weui-btn_primary" href="javascript:cancelDownload();">取消下载</a>
           </div>
          
        </div>
    </div>
</div>
<script type="text/javascript">
   function addTest(){
   		var path = "https://soucre.oss-cn-hangzhou.aliyuncs.com/appversion/test.zip";
   		$("#js_input").val(path);
   	}
   	
   function cancelDownload() {
   		var url = $("#js_input").val();
   		 api.cancelDownload(url);
   	}
</script>
</script>


<script type="text/html" id="tpl_dqwj">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	读取文件
	</div>
    <div class="page__bd">
       <div class="weui-form">
           <div class="weui-form__control-area">
             <div class="weui-cells__group weui-cells__group_form"> 
               <div class="weui-cells weui-cells_form">
                 <div class="weui-cell weui-cell_active">
                   <div class="weui-cell__hd"><label class="weui-label">地址</label></div>
                   <div class="weui-cell__bd">
                       <textarea id="js_input" class="weui-textarea" rows="3" placeholder="请填写读取地址"></textarea>
                   </div>
                 </div> 
               </div>
             </div>
           </div> 
           <div class="weui-form__opr-area">
             <a class="weui-btn weui-btn_primary weui-btn_disabled" href="javascript:" id="showTooltips">读取</a>
           </div> 
		   
		   <div class="weui-cells__group weui-cells__group_form">
		   	<div class="weui-cells__title">读取内容</div>
		   	<div class="weui-cells weui-cells_form">
		   		<div class="weui-cell ">
		   			<div class="weui-cell__bd" id="methodResultBox" style="overflow: auto;height: 200px;">
		   				<textarea class="weui-textarea" id="methodResult" placeholder="这里显示结果" style="height: 100%;"></textarea>
		   			</div>
		   		</div>
		   	</div>
		     </div>
         </div>
    </div>
	
	<div id="js_toast" style="opacity: 0; display: none;">
	      <div class="weui-mask_transparent"></div>
	      <div class="weui-toast">
	          <i id="toast_icon" class="weui-icon-success-no-circle weui-icon_toast"></i>
	          <p class="weui-toast__content">已完成</p>
	      </div>
	  </div>
</div>
<script type="text/javascript">
       $(function(){ 
         var $input = $('#js_input');
         $input.on('input', function(){
           if ($input.val()){
             $('#showTooltips').removeClass('weui-btn_disabled');
           }else{
             $('#showTooltips').addClass('weui-btn_disabled');
           }
         });
         $('#showTooltips').on('click', function(){
           if ($(this).hasClass('weui-btn_disabled')) return;
   
		   var path = $("#js_input").val(); 
		   api.readFile(path,function(ret){
			   if(ret){
				   $("#methodResult").val(ret);
				   showTips(false,"读取成功");
			   }else{
				   showTips(true,"读取失败");
			   }
			  
		   }); 
          
         });
       });
	   
	   function showTips(isErr,msg){
		   var $toast = $('#js_toast');
		   $('.page.cell').removeClass('slideIn');
		   if(isErr){
			   $("#toast_icon").removeClass("weui-icon-success-no-circle");
			   $("#toast_icon").addClass("weui-icon-warn");
		   }else{
			   $("#toast_icon").addClass("weui-icon-success-no-circle");
			   $("#toast_icon").removeClass("weui-icon-warn");
		   }
		   $(".weui-toast__content").html(msg);
		   $toast.fadeIn(100);
		   setTimeout(function () {
		     $toast.fadeOut(100);
		   }, 2000);
	   }
</script>
</script>

<script type="text/html" id="tpl_xrwj">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	写入文件
	</div>
    <div class="page__bd">
        <div class="weui-form">
            <div class="weui-form__control-area">
              <div class="weui-cells__group weui-cells__group_form"> 
                <div class="weui-cells weui-cells_form">
                  <div class="weui-cell weui-cell_active">
                    <div class="weui-cell__hd"><label class="weui-label">地址</label></div>
                    <div class="weui-cell__bd">
                        <textarea id="js_input" class="weui-textarea" rows="3" placeholder="请填写写入地址"></textarea>
                    </div>
                  </div> 
				  
				  <div class="weui-cell weui-cell_active">
				    <div class="weui-cell__hd"><label class="weui-label">内容</label></div>
				    <div class="weui-cell__bd">
				        <textarea id="js_text" class="weui-textarea" rows="6" placeholder="请填写写入内容"></textarea>
				    </div>
				  </div> 
				  
                </div>
              </div>
            </div> 
            <div class="weui-form__opr-area">
              <a class="weui-btn weui-btn_primary weui-btn_disabled" href="javascript:" id="showTooltips">写入</a>
            </div>  
          </div>
		  <div id="js_toast" style="opacity: 0; display: none;">
		        <div class="weui-mask_transparent"></div>
		        <div class="weui-toast">
		            <i id="toast_icon" class="weui-icon-success-no-circle weui-icon_toast"></i>
		            <p class="weui-toast__content">已完成</p>
		        </div>
		    </div>
    </div>
</div>
<script type="text/javascript">
   $(function(){
     var $input = $('#js_input');
     $input.on('input', function(){
       if ($input.val()){
         $('#showTooltips').removeClass('weui-btn_disabled');
       }else{
         $('#showTooltips').addClass('weui-btn_disabled');
       }
     });
     $('#showTooltips').on('click', function(){
       if ($(this).hasClass('weui-btn_disabled')) return;
      
   		   var path = $("#js_input").val(); 
		   var text = $("#js_text").val(); 
   		   api.writeFile(path,text,function(ret){
   			   if(ret){ 
   				   showTips(false,"写入成功");
   			   }else{
   				   showTips(true,"写入失败");
   			   }
   			  
   		   }); 
      
     });
   });
   
   function showTips(isErr,msg){
   		   var $toast = $('#js_toast');
   		   $('.page.cell').removeClass('slideIn');
   		   if(isErr){
   			   $("#toast_icon").removeClass("weui-icon-success-no-circle");
   			   $("#toast_icon").addClass("weui-icon-warn");
   		   }else{
   			   $("#toast_icon").addClass("weui-icon-success-no-circle");
   			   $("#toast_icon").removeClass("weui-icon-warn");
   		   }
   		   $(".weui-toast__content").html(msg);
   		   $toast.fadeIn(100);
   		   setTimeout(function () {
   		     $toast.fadeOut(100);
   		   }, 2000);
   }
</script>
</script>


<script type="text/html" id="tpl_xrjzsj">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	写入键值数据
	</div>
    <div class="page__bd">
        <div class="weui-form">
            <div class="weui-form__control-area">
				<div class="weui-cells__title">此功能主要适用于小量配置信息的读写，在APP启动时会以map的形式载入内存，拿取数据的速度非常快可以忽略不记</div>
              <div class="weui-cells__group weui-cells__group_form"> 
                <div class="weui-cells weui-cells_form">
                  <div class="weui-cell weui-cell_active">
                    <div class="weui-cell__hd"><label class="weui-label">key</label></div>
                    <div class="weui-cell__bd">
                        <textarea id="js_input" class="weui-textarea" rows="3" placeholder="请填写key"></textarea>
                    </div>
                  </div> 
				  
				  <div class="weui-cell weui-cell_active">
				    <div class="weui-cell__hd"><label class="weui-label">value</label></div>
				    <div class="weui-cell__bd">
				        <textarea id="js_text" class="weui-textarea" rows="6" placeholder="请填写value"></textarea>
				    </div>
				  </div> 
				  
                </div>
              </div>
            </div> 
            <div class="weui-form__opr-area">
              <a class="weui-btn weui-btn_primary weui-btn_disabled" href="javascript:" id="showTooltips">写入</a>
            </div>  
          </div>
		  <div id="js_toast" style="opacity: 0; display: none;">
		        <div class="weui-mask_transparent"></div>
		        <div class="weui-toast">
		            <i id="toast_icon" class="weui-icon-success-no-circle weui-icon_toast"></i>
		            <p class="weui-toast__content">已完成</p>
		        </div>
		    </div>
    </div>
</div>
<script type="text/javascript">
   $(function(){
     var $input = $('#js_input');
     $input.on('input', function(){
       if ($input.val()){
         $('#showTooltips').removeClass('weui-btn_disabled');
       }else{
         $('#showTooltips').addClass('weui-btn_disabled');
       }
     });
     $('#showTooltips').on('click', function(){
       if ($(this).hasClass('weui-btn_disabled')) return;
      
   		   var key = $("#js_input").val(); 
		   var value = $("#js_text").val(); 
   		   api.putData(key,value);
		   showTips(false,"写入成功");
      
     });
   });
   
   function showTips(isErr,msg){
   		   var $toast = $('#js_toast');
   		   $('.page.cell').removeClass('slideIn');
   		   if(isErr){
   			   $("#toast_icon").removeClass("weui-icon-success-no-circle");
   			   $("#toast_icon").addClass("weui-icon-warn");
   		   }else{
   			   $("#toast_icon").addClass("weui-icon-success-no-circle");
   			   $("#toast_icon").removeClass("weui-icon-warn");
   		   }
   		   $(".weui-toast__content").html(msg);
   		   $toast.fadeIn(100);
   		   setTimeout(function () {
   		     $toast.fadeOut(100);
   		   }, 2000);
   }
</script>
</script>



<script type="text/html" id="tpl_dqjzsj">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	读取键值数据
	</div>
    <div class="page__bd">
       <div class="weui-form">
           <div class="weui-form__control-area">
             <div class="weui-cells__group weui-cells__group_form"> 
               <div class="weui-cells weui-cells_form">
                 <div class="weui-cell weui-cell_active">
                   <div class="weui-cell__hd"><label class="weui-label">key</label></div>
                   <div class="weui-cell__bd">
                       <textarea id="js_input" class="weui-textarea" rows="3" placeholder="请填写key"></textarea>
                   </div>
                 </div> 
               </div>
             </div>
           </div> 
           <div class="weui-form__opr-area">
             <a class="weui-btn weui-btn_primary weui-btn_disabled" href="javascript:" id="showTooltips">读取</a>
           </div> 
		   
		   <div class="weui-cells__group weui-cells__group_form">
		   	<div class="weui-cells__title">读取内容</div>
		   	<div class="weui-cells weui-cells_form">
		   		<div class="weui-cell ">
		   			<div class="weui-cell__bd" id="methodResultBox" style="overflow: auto;height: 200px;">
		   				<textarea class="weui-textarea" id="methodResult" placeholder="这里显示结果" style="height: 100%;"></textarea>
		   			</div>
		   		</div>
		   	</div>
		     </div>
         </div>
    </div>
	
	<div id="js_toast" style="opacity: 0; display: none;">
	      <div class="weui-mask_transparent"></div>
	      <div class="weui-toast">
	          <i id="toast_icon" class="weui-icon-success-no-circle weui-icon_toast"></i>
	          <p class="weui-toast__content">已完成</p>
	      </div>
	  </div>
</div>
<script type="text/javascript">
       $(function(){ 
         var $input = $('#js_input');
         $input.on('input', function(){
           if ($input.val()){
             $('#showTooltips').removeClass('weui-btn_disabled');
           }else{
             $('#showTooltips').addClass('weui-btn_disabled');
           }
         });
         $('#showTooltips').on('click', function(){
           if ($(this).hasClass('weui-btn_disabled')) return;
   
		   var key = $("#js_input").val(); 
		   var value = api.getData(key); 
           $("#methodResult").val(value);
		   if(value){
			  showTips(false,"读取成功");
		   }else{
			  showTips(true,"读取失败");
		   }
          
         });
       });
	   
	   function showTips(isErr,msg){
		   var $toast = $('#js_toast');
		   $('.page.cell').removeClass('slideIn');
		   if(isErr){
			   $("#toast_icon").removeClass("weui-icon-success-no-circle");
			   $("#toast_icon").addClass("weui-icon-warn");
		   }else{
			   $("#toast_icon").addClass("weui-icon-success-no-circle");
			   $("#toast_icon").removeClass("weui-icon-warn");
		   }
		   $(".weui-toast__content").html(msg);
		   $toast.fadeIn(100);
		   setTimeout(function () {
		     $toast.fadeOut(100);
		   }, 2000);
	   }
</script>
</script>


<script type="text/html" id="tpl_lykz">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	录音控制
	</div>
    <div class="page__hd">
        <div class="j_info page__info" data-for="normal">
           <div class="weui-form__opr-area"> 
				<div class="weui-form__text-area">
				      <h4 class="weui-form__title">录音时间:<span id="time">00:00</span></h4>
				      <div class="weui-form__desc">录音状态:<span id="msg">未开始</span></div> 
				</div>
				</br>
				<div class="weui-slider-box">
					<div class="weui-slider">
						<div id="sliderInner" class="weui-slider__inner">
							<div id="sliderTrack" style="width: 0%;" class="weui-slider__track"></div>
							<div id="sliderHandler" style="left: 0%;" class="weui-slider__handler"></div>
						</div>
					</div>
					<div id="sliderValue" class="weui-slider-box__value">0%</div>
				</div>
				</br>
				</br>
				<div class="weui-cell weui-cell_active">
				  <div class="weui-cell__hd"><label class="weui-label">录音时长</label></div>
				  <div class="weui-cell__bd">
				      <input id="js_input" class="weui-input" type="number" value="30" placeholder="请输入时长"/>
				  </div>
				  <div class="weui-cell__ft">
					秒
				  </div>
				</div> 
				<div class="button-sp-area">
				    <a href="javascript:startRecord();" class="weui-btn weui-btn_primary">开始录音</a>
					<a href="javascript:pauseRecord();" id="zanting" class="weui-btn weui-btn_default">暂停录音</a>
					<a href="javascript:stopRecord();" class="weui-btn weui-btn_warn">停止录音</a>
					<a href="javascript:cancelRecord();" class="weui-btn weui-btn_default">取消录音</a>
				</div>
				
				<div class="weui-cell weui-cell_active">
				  <div class="weui-cell__hd"><label class="weui-label">地址</label></div>
				  <div class="weui-cell__bd">
				      <textarea id="js_path" class="weui-textarea" placeholder="完成录音的地址"></textarea>
				  </div> 
				</div> 
           </div>
        </div>
		
		
		<div class="weui-cells__group weui-cells__group_form">
			<div class="weui-cells__title">输出日志</div>
			<div class="weui-cells weui-cells_form">
				<div class="weui-cell ">
					<div class="weui-cell__bd" id="methodResultBox" style="overflow: auto;height: 200px;">
						<div class="weui-textarea" id="methodResult" style="height: 100%;"></div>
					</div>
				</div>
			</div>
		  </div>
    </div>
</div>
<script type="text/javascript">
	function startRecord(){
		var time = $("#js_input").val();
		$("#js_path").val("");
		api.startRecord(time,function(ret){
			pushLog(ret);
			var data = JSON.parse(ret);
			$("#time").html(data.time);
			$("#msg").html(data.msg);
			$("#js_input").val(data.maxTime);
			$("#sliderTrack").attr("style","width:"+data.progress+"%;");
			$("#sliderHandler").attr("style","left:"+data.progress+"%;");
			$("#sliderValue").html(data.progress+"%");
			if(data.action=="COMPLETE"){
				$("#js_path").val(data.path);
			} 
		});
	}
	
	
	function pauseRecord() {
		var title = $api.html($api.byId('zanting'));
		if(title=='暂停录音'){
			$api.html($api.byId('zanting'),'继续录音');
		}else{
			$api.html($api.byId('zanting'),'暂停录音');
		}
		 api.pauseRecord();
	}
	
   function stopRecord() {
		 api.stopRecord(true);
	}

	function cancelRecord() {
		 api.stopRecord(false);
	}


	
   function pushLog(log){ 
   		  var box = $api.byId('methodResult');
   		  var date = new Date();
   		  var fdate = date.format("yyyy-MM-dd hh:mm:ss");
   		  $api.append(box,fdate+' '+log+"<br/>");
   		  $api.byId('methodResultBox').scrollTop = box.scrollHeight;
   }
</script>
</script>


<script type="text/html" id="tpl_lylb">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	录音列表
	</div>
    <div class="page__hd">
        <div class="j_info page__info" data-for="normal">
           <div class="weui-form__opr-area"> 
		   
           </div>
        </div>
    </div>
</div>
<script type="text/javascript">
   
</script>
</script>

 

<script type="text/html" id="tpl_jcxbb">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	检查新版本
	</div>
    <div class="page__hd">
        <div class="j_info page__info" data-for="normal">
           <div class="weui-form__opr-area"> 
				<div class="button-sp-area">
				    <a href="javascript:checkVersion();" class="weui-btn weui-btn_primary">点击检查新版本</a> 
				</div>
           </div>
        </div>
    </div>
</div>
<script type="text/javascript">
   function checkVersion(){
	    api.checkUpdate();
   }
</script>
</script>


<script type="text/html" id="tpl_zxazxyy">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	在线安装新应用
	</div>
    <div class="page__hd">
        <div class="j_info page__info" data-for="normal">
           <div class="weui-form__opr-area"> 
		   
           </div>
        </div>
    </div>
</div>
<script type="text/javascript">
   
</script>
</script>


<script type="text/html" id="tpl_ckyylb">
<div class="page">
	<div class="header">
	<div class="back" onclick="history.back();">
	<img src="images/icon_left.png"/>
	</div>
	查看应用列表
	</div>
    <div class="page__hd">
        <div class="j_info page__info" data-for="normal">
           <div class="weui-form__opr-area"> 
		   
           </div>
        </div>
    </div>
</div>
<script type="text/javascript">
   
</script>
</script>


    <script src="js/zepto.min.js"></script>
    <script type="text/javascript" src="js/jweixin-1.0.0.js"></script>
    <script src="js/weui.min.js"></script>
    <script src="js/index.js"></script>
	<script src="js/api.js"></script>
</body>
</html>
